/**
 * 查询某个元素
 * @param {string} selector 组件选择器
 * @param target 组件 this
 */
export function queryRect(selector, target = null) {
  return new Promise((resolve) => {
    let query = uni.createSelectorQuery()
    if (target) {
      query = query.in(target)
    }
    query.select(selector).boundingClientRect()
    query.exec(resolve)
  })
}
